<?php
	class Demo2 {
		public $a, $b, $c;

		public function Demo2($a = 0, $b = 0, $c = 0) {
			if ($a) $this -> a = $a;
			if ($b) $this -> b = $b;
			if ($c) $this -> c = $c;
		}

		public function sum($d = 0) {
			if($d) {
				return $this -> a + $this -> b + $this -> c + $d;
			} else {
				return $this -> a + $this -> b + $this -> c;
			}
		}
	}

	$demo = new Demo2(1, 2, 3);
	echo $demo -> sum(5)."<br/>";
	echo $demo -> sum()."<br/>";
?>